#include<bits/stdc++.h>
using namespace std;
#define int long long

int a[15];

signed main() {
	for (int i = 1; i <= 10; i++)
		cin >> a[i];
	int h;
	cin >> h;

	sort(a + 1, a + 11);
	cout << upper_bound(a + 1, a + 11, h + 30) - a - 1;
	return 0;
}
